import { fetch } from './config'

export default {

  // 团队管理 接口
  teams(params) {
    return fetch(`/agencies/teams`, params, 'get')
  },

  // 团队成员查询 接口
  members(params) {
    return fetch(`/agencies/teams/members`, params, 'get')
  },

  // 申请加入团队 接口
  reviews(params) {
    return fetch(`/agencies/teams/members/reviews`, params, 'post', { headers: { 'Content-Type': 'application/json' } })
  },

  // 团队成员详情 接口
  teamsdetail(params) {
    return fetch(`/agencies/teams/members`, params, 'detail')
  },

  // 团队详情 接口
  teamsxiangqi(params) {
    return fetch(`/agencies/teams/`, params, 'detail')
  },

  // 图片上传 接口
  assets(params) {
    return fetch(`/assets`, params, 'post', { headers: { 'Content-Type': 'multipart/form-data' } })
  },


  //  变更成员所在团队 接口
  genghuan(params) {
    return fetch('/agencies/teams/members/' + params.memberId + '/team', params, 'patch')
  },

  // 入团申请查询 接口
  reviewscha(params) {
    return fetch(`/agencies/teams/members/reviews`, params, 'get')
  },

  //   入团审核 接口
  league(params) {
    return fetch(`/agencies/teams/members/reviews`, params, 'patch')
  },

  //  团队长设置 接口
  administrator(params) {
    return fetch('/agencies/teams/' + params.teamId + '/administrator', params, 'patch')
  },

  //  解除成员所在团队 接口
  membersmemberId(params) {
    return fetch('/agencies/teams/members/' + params + '/team', params, 'deleteA')
  },

  // 团队新增/编辑 接口
  addbteams(params) {
    return fetch(`/agencies/teams`, params, 'post')
  },

  // 团队新增/编辑 接口
  xiagaiteams(params) {
    return fetch(`/agencies/teams`, params, 'put')
  },


  //  成员角色设置 接口
  roles(params) {
    return fetch('/agencies/teams/members/' + params.memberId + '/roles', params, 'patch')
  },

  // 成员费率设置 接口
  businesses(params) {
    return fetch('/agencies/teams/members/' + params.memberId + '/businesses', params.businesses, 'post', { headers: { 'Content-Type': 'application/json' } })
  },

  //  生成入团二维码 接口
  qrcode(params) {
    return fetch(`/agencies/teams/members/invite-qrcode`, params, 'get')
  }

}
